#!/bin/bash
# --------------------------------------------------
#Author:  LJ
#Email:   admin@attacker.club

#Last Modified: 2018-11-01 13:49:48
#Description:
# --------------------------------------------------

if [ -d /etc ];then 
echo "存在目录" 
fi

if [ -f /etc/passwd ];then 
echo "存在文件" 
fi

if [ ! -f /etc/passwd ];then 
echo "不存在文件" 
else 
echo "存在文件" 
fi

if [ -w file  ]    #如果文件存在且可写
if [ -x file  ]    #如果文件存在且可执行 


netstat -tnpl|grep zabbix_server &> /dev/null
if [ $? -ne 0 ];then
 echo -e  "\e[1;33mServices is off\e[0m"
 /etc/zabbix/alertscripts/weixin.py   "18042457451"  "alert"  "zabbix_server down"
 exit
fi
#服务参考